package com.sjl.springboot.exception;

import com.sjl.springboot.domain.enums.CommonCode;
import lombok.Getter;
import lombok.Setter;

/**
 * @author sjl
 * @version V1.0
 * @date 2019/1/10 0010 9:26
 */
@Getter
@Setter
public class DiyException extends Exception {
    private String errCode;

    private String errReason;


    public DiyException(String errCode, String errReason) {
        super( "[" + errCode + "]" + errReason);
        this.errCode = errCode;
        this.errReason = errReason;
    }
    public DiyException(CommonCode commonCode) {
        super( "[" + commonCode.getCode() + "]" + commonCode.getMsg());
        this.errCode = commonCode.getCode();
        this.errReason = commonCode.getMsg();
    }

}
